﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Antioch.Base
{
	[Jemgine.Engine.Category("Antioch Navigation"), Jemgine.Engine.Component]
	public class PushPullGrabPoint : PlayerNavigationNode
	{
        protected override void SetExtents(Jemgine.Math.OBB OBB)
        {
            OBB.Extents = new Vector2(4,1);
            OBB.Angle = base.Angle;
        }

        public bool CanGrab(Jemgine.Data.EntityRecord Entity)
        {
            float HangAngle = Jemgine.Math.Angle.Normalize(Angle + Me.Angle);
            float HangAngleDelta = Jemgine.Math.Angle.Delta(Jemgine.Math.Angle.Normalize(Entity.Angle), HangAngle);


            switch (Entity.Facing)
            {
                case Jemgine.Data.Facings.Left:
                    return HangAngleDelta > 0.0f;
                case Jemgine.Data.Facings.Right:
                    return HangAngleDelta < 0.0f;
            }
            return true;
        }
    }

 
}
